package com.lixingye.meowstar.dao;

import com.lixingye.meowstar.model.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 猫大仙
 * @since 2025-01-14
 */
@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    List<Article> selectAll();

    /**
     * 根据板块id查询所有帖子列表
     * @param boardId
     * @return
     */
    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);

    /**
     * 根据帖子id查询详情
     * @param id
     * @return
     */
    Article selectDetailById(@Param("id") Long id);

    int updateByPrimaryKeySelective(Article record);

    /**
     * 根据用户id查询帖子列表
     * @param userId
     * @return
     */
    List<Article> selectByUserId(@Param("userId") Long userId);
}

